# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=itinerary
pkgver=24.08.2
pkgrel=0
# armhf blocked by qt6-qtdeclarative
# ppc64le blocked by kitinerary
# s390x blocked by qt6-qtdeclarative
arch="aarch64 armv7 x86_64 x86"
url="https://invent.kde.org/pim/itinerary"
pkgdesc="Itinerary and boarding pass management application"
license="BSD-3-Clause AND LGPL-2.0-or-later"
depends="
	kirigami
	kirigami-addons
	kitemmodels
	kopeninghours
	prison
	qqc2-desktop-style
	qt6-qtlocation
	tzdata
	"
makedepends="
	extra-cmake-modules
	kcontacts-dev
	kcoreaddons-dev
	kdbusaddons-dev
	kholidays-dev
	ki18n-dev
	kirigami-addons-dev
	kitinerary-dev
	knotifications-dev
	kosmindoormap-dev
	kpkpass-dev
	kpublictransport-dev
	kunitconversion-dev
	networkmanager-qt-dev
	qqc2-desktop-style-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtlocation-dev
	qtkeychain-dev
	samurai
	shared-mime-info
	solid-dev
	zlib-dev
	"
checkdepends="
	dbus
	qqc2-desktop-style
	sonnet
	xvfb-run
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/pim/itinerary.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/itinerary-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# tripgrouptest and timelinemodel test are broken
	dbus-run-session -- xvfb-run -a ctest --test-dir build --output-on-failure -E "(tripgroup|timelinemodel|itinerary-self-)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
fd278b5d96434a1652daa04f1ec02d04cf96b8573e196a243d3ef933f62f4160faaf11817b9f315b8edf9831a04d2d369a413b415b57801f44f34fe1a32825bc  itinerary-24.08.2.tar.xz
"
